package reduce.fz.com.reduce.service;

import android.content.Context;
import android.content.Intent;

import java.util.HashMap;
import java.util.List;

import reduce.fz.com.reduce.R;
import reduce.fz.com.reduce.abstracts.AbResponseListener;
import reduce.fz.com.reduce.adapter.AbstractRecycleHolder;
import reduce.fz.com.reduce.bean.StoryCard;
import reduce.fz.com.reduce.bean.StoryPicCard;
import reduce.fz.com.reduce.bean.StoryReply;
import reduce.fz.com.reduce.bean.page.Pagination;
import reduce.fz.com.reduce.util.ApiUtil;
import reduce.fz.com.reduce.util.HttpUtils;

/**
 * Created by qingshengzheng on 15/10/16.
 */
public class StoryService {
    private Context context;

    public StoryService(Context context) {
        this.context = context;
    }

    public void loadWitnessMianCard(Long uid,Long teamid,AbResponseListener<List<StoryPicCard>> listener) {
        String url = ApiUtil.getApi(context, R.array.api_account_bind,uid,teamid);
        HttpUtils.get(url, listener);
    }
    public void pubStoryCard(StoryCard card ,AbResponseListener listener)
    {
        String url = ApiUtil.getApi(context, R.array.api_story_pub);
        HttpUtils.jsonPost(url, card,listener);
    }
    public void loadStoryDetail(Long storyid,AbResponseListener listener)
    {
        String url=ApiUtil.getApi(context,R.array.api_story_detail,storyid);
        HttpUtils.get(url,listener);
    }
    public void replyStory(StoryReply reply,AbResponseListener listener)
    {
        String url=ApiUtil.getApi(context,R.array.api_account_bind);
        HttpUtils.get(url,listener);
    }

    public void storyUseFul(Long storyid,int type,AbResponseListener listener)
    {
        String url=ApiUtil.getApi(context,R.array.api_story_use,storyid);
        HashMap temp=new HashMap<>();
        temp.put("type",type);
        HttpUtils.post(url, temp, listener);
    }



}
